[BugFix] Directly Convert Modifiers to Recipe Instance#1271
Merged
Conversation
… Recipe Add e2e tests for recipe parsing Signed-off-by: Rahul Tuli <rahul@neuralmagic.com>
|
👋 Hi! Thank you for contributing to llm-compressor. Please add the ready label when the PR is ready for review. Note: This is required to complete the testing suite, please only add the label once the PR is code complete and local testing has been performed. |
Collaborator
brian-dellabetta
left a comment
There was a problem hiding this comment.
looks good! couple suggestions based on the parts i understand
Signed-off-by: Rahul Tuli <rahul@neuralmagic.com>
Signed-off-by: Rahul Tuli <rahul@neuralmagic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, the process of recipe creation follows this sequence:
Modifiers → String (Serialization) → Recipe Instance (Deserialization)
This intermediate serialization and deserialization step introduces issues when dealing with more complex objects, such as SmoothQuant mappings, which can lead to parsing errors.
Solution
This PR refactors the flow to directly construct the Recipe Instance from Modifiers, thereby removing an unnecessary conversion step and eliminating a potential source of error.
Issue Tracking
This issue was originally surfaced in [vllm-project/llm-compressor#37](#37) and is formally tracked under [INFERENG-358](https://issues.redhat.com/browse/INFERENG-358).
Testing
The issue was reproduced using the following script, which previously errored out but now runs successfully with this fix:
With this fix, the script now runs to completion without errors. Automated tests have also been added to test new changes